Print help message if cargo is invoked with no arguments
authorAshok Gautham <ScriptDevil@zoho.com>
Wed, 20 Aug 2014 17:04:39 +0000 (22:34 +0530)
committerAshok Gautham <ScriptDevil@zoho.com>
Wed, 20 Aug 2014 17:04:39 +0000 (22:34 +0530)
src/bin/cargo.rs

index b22a3a9edfe2a025c3d8a6a123093955cb22f52f..a5fa3ec16647cd9e7a8527b91a6167455d8f847e 100644 (file)
@@ -87,9 +87,10 @@ fn execute(flags: Flags, shell: &mut MultiShell) -> CliResult<Option<()>> {
                                                    args.as_slice(), false);
             cargo::process_executed(r, shell)
         },
-        // If we have `help` with no arguments, re-invoke ourself with `-h` to
-        // get the help message printed
-        "help" if flags.arg_args.len() == 0 => {
+        // If we are invoked with no arguments or with `help` with no
+        // arguments, re-invoke ourself with `-h` to get the help
+        // message printed
+        "" | "help" if flags.arg_args.len() == 0 => {
             shell.set_verbose(true);
             let r = cargo::call_main_without_stdin(execute, shell,
                                                    ["-h".to_string()], false);